/**
 * 详情对话框
 */
var DsstoreBillDeliveryInfoDlg = {
    data: {
        billNo: "",
        otherSideName: "",
        shopName: "",
        itemBigClassName: "",
        itemAssistNo: "",
        itemSpec: "",
        sellTaxes: "",
        itemSmallClassCode: "",
        arriveMoney: "",
        storeCode: "",
        outputRate: "",
        storeBillRemark: "",
        outMainAmount: "",
        itemSign: "",
        shopCode: "",
        taxMoney: "",
        storeBillDtid: "",
        modifyDate: "",
        storeName: "",
        storeBillidRemark: "",
        mainUnit: "",
        giftFlag: "",
        outStoreMoney: "",
        itemId: "",
        itemSmallClassName: "",
        storeBillReState: "",
        busUser: "",
        taxes: "",
        batchCode: "",
        inStoreMoney: "",
        isOut: "",
        shopId: "",
        makeTime: "",
        billBusType: "",
        processMoney: "",
        itemCode: "",
        pushOutStoreMoney: "",
        inMainAmount: "",
        pushOutStoreAmount: "",
        storeBillId: "",
        sellIncludeTaxMoney: "",
        outBusAmount: "",
        otherSideType: "",
        pushInStoreMoney: "",
        yield: "",
        arriveAmount: "",
        itemName: "",
        sysBatchCode: "",
        createDate: "",
        auditDate: "",
        otherSideId: "",
        billType: "",
        sellTaxMoney: "",
        billBusTypeId: "",
        pushInStoreAmount: "",
        inBusAmount: "",
        busDate: "",
        aPYear: "",
        itemBigClassCode: "",
        saleMoney: "",
        storeId: "",
        itemAbc: "",
        arrivalDate: "",
        aPMonth: "",
        otherSideCode: "",
        busUnit: "",
        includeTaxMoney: "",
        parentBillNo: ""
    }
};

layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;


    //下拉多选框
    var formSelects = layui.formSelects;
    formSelects.config('selitemCode', {
        searchUrl: Feng.ctxPath + "/selectList",//请更换成您自己的url,可参考项目中的其他接口
        keyName: 'name',//更换成自己的keyName,可参考项目中的其他接口
        keyVal: 'id'//更换成自己的keyVal,可参考项目中的其他接口
    });



    //渲染时间选择框
    var laydate = layui.laydate;
    laydate.render({
        elem: '#busDate' //指定元素
    });


    //获取详情信息，填充表单
    var ajax = new $ax(Feng.ctxPath + "/dsstoreBillDelivery/detail?storeBillDtid=" + Feng.getUrlParam("storeBillDtid"));
    var result = ajax.start();
    form.val('dsstoreBillDeliveryForm', result.data);

    //表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/dsstoreBillDelivery/editItem", function (data) {
            Feng.success("更新成功！");
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("更新失败！" + data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();

        return false;
    });

});
